package com.zywl.core.beans;

import com.zywl.utils.utils.IPUtil;

import javax.servlet.http.HttpServletRequest;
import java.util.Date;

public class Log {
    private Long logId;

    private Long logUserId;

    private String logUserAcc;

    private String logUserName;

    private String logIp;

    private String logMac;

    private Date logSingTime;

    private String logType;

    private String logPhoneNumber;

    private String logCounty;

    private String logStreet;

    private String logStt;

    private Date logCreateTime;

    private Date logModifyTime;

    private String logContent;

    private Long logAssociationId;

    public Log() {
    }

    public Log(HttpServletRequest request, User user, String logType, String content) {
        Date date = new Date();
        this.logAssociationId = user.getUsrAssociationId();
        this.logUserId = user.getUsrId();
        this.logUserAcc = user.getUsrUsername();
        this.logUserName = user.getUsrName();
        this.logIp = IPUtil.getIpAddress(request);
        this.logSingTime = date;
        this.logType = logType;
        this.logPhoneNumber = user.getUsrMobile();
        this.logContent = content;
//        this.logMac = IPUtil.getMacAddrByIp(IPUtil.getIpAddress(request));
        this.logStt = "0";
        this.logCreateTime = date;
        this.logModifyTime = date;
    }

    public Long getLogId() {
        return logId;
    }

    public void setLogId(Long logId) {
        this.logId = logId;
    }

    public Long getLogUserId() {
        return logUserId;
    }

    public void setLogUserId(Long logUserId) {
        this.logUserId = logUserId;
    }

    public String getLogUserAcc() {
        return logUserAcc;
    }

    public void setLogUserAcc(String logUserAcc) {
        this.logUserAcc = logUserAcc == null ? null : logUserAcc.trim();
    }

    public String getLogUserName() {
        return logUserName;
    }

    public void setLogUserName(String logUserName) {
        this.logUserName = logUserName == null ? null : logUserName.trim();
    }

    public String getLogIp() {
        return logIp;
    }

    public void setLogIp(String logIp) {
        this.logIp = logIp == null ? null : logIp.trim();
    }

    public String getLogMac() {
        return logMac;
    }

    public void setLogMac(String logMac) {
        this.logMac = logMac == null ? null : logMac.trim();
    }

    public Date getLogSingTime() {
        return logSingTime;
    }

    public void setLogSingTime(Date logSingTime) {
        this.logSingTime = logSingTime;
    }

    public String getLogType() {
        return logType;
    }

    public void setLogType(String logType) {
        this.logType = logType == null ? null : logType.trim();
    }

    public String getLogPhoneNumber() {
        return logPhoneNumber;
    }

    public void setLogPhoneNumber(String logPhoneNumber) {
        this.logPhoneNumber = logPhoneNumber == null ? null : logPhoneNumber.trim();
    }

    public String getLogCounty() {
        return logCounty;
    }

    public void setLogCounty(String logCounty) {
        this.logCounty = logCounty == null ? null : logCounty.trim();
    }

    public String getLogStreet() {
        return logStreet;
    }

    public void setLogStreet(String logStreet) {
        this.logStreet = logStreet == null ? null : logStreet.trim();
    }

    public String getLogStt() {
        return logStt;
    }

    public void setLogStt(String logStt) {
        this.logStt = logStt == null ? null : logStt.trim();
    }

    public Date getLogCreateTime() {
        return logCreateTime;
    }

    public void setLogCreateTime(Date logCreateTime) {
        this.logCreateTime = logCreateTime;
    }

    public Date getLogModifyTime() {
        return logModifyTime;
    }

    public void setLogModifyTime(Date logModifyTime) {
        this.logModifyTime = logModifyTime;
    }

    public String getLogContent() {
        return logContent;
    }

    public void setLogContent(String logContent) {
        this.logContent = logContent == null ? null : logContent.trim();
    }

    public Long getLogAssociationId() {
        return logAssociationId;
    }

    public void setLogAssociationId(Long logAssociationId) {
        this.logAssociationId = logAssociationId;
    }
}